package com.ming.transaction.common.annotation;

import com.ming.transaction.config.RabbitMQConfig;
import com.ming.transaction.entity.Dialy;
import com.ming.transaction.service.IDialyService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 队列监听器
 * @author: Chenming
 * @date 2023/5/9 18:46
 */
@Component
public class LogMQlistener {

    @Resource
    private IDialyService dialyService;

    @RabbitListener(queues = RabbitMQConfig.ITEM_QUEUE)
    public void log(Dialy dialy){
        dialyService.save(dialy);
    }
}
